@page "/components/pdfreader"

<PageOutlet Url="components/pdfreader"
            Title="PdfReader"
            Description="pdfreader component of the bit BlazorUI components" />

<DemoPage Name="PdfReader"
          Description="BitPdfReader is a simple pdf renderer utilizing the pdfjs library to bring pdf reading feature into Blazor world."
          Parameters="componentParameters"
          SubClasses="componentSubClasses"
          GitHubExtrasUrl="PdfReader/BitPdfReader.razor"
          GitHubDemoUrl="Extras/PdfReader/BitPdfReaderDemo.razor">
    <NotesTemplate>
        <BitText>
            To use this component, you need to install the
            <BitLink Href="https://www.nuget.org/packages/Bit.BlazorUI.Extras" Target="_blank">
                <BitTag Reversed
                        Text="Bit.BlazorUI.Extras"
                        Color="BitColor.SecondaryBackground"
                        IconName="@BitIconName.NavigateExternalInline" />
            </BitLink>
            nuget package, as described in the Optional steps of the
            <BitLink Href="/getting-started">Getting started</BitLink> page.
        </BitText>
    </NotesTemplate>
    <Examples>
        <DemoExample Title="Basic" RazorCode="@example1RazorCode" CsharpCode="@example1CsharpCode" Id="example1">
            <BitPdfReader Config="basicConfig" />
        </DemoExample>

        <DemoExample Title="RenderAllPages" RazorCode="@example2RazorCode" CsharpCode="@example2CsharpCode" Id="example2">
            <BitPdfReader RenderAllPages Horizontal Config="renderAllConfig" />
        </DemoExample>

        <DemoExample Title="Public API" RazorCode="@example3RazorCode" CsharpCode="@example3CsharpCode" Id="example3">
            <div>
                <BitButton OnClick="() => publicApiPdfReaderRef!.First()">First</BitButton>&nbsp;
                <BitButton OnClick="() => publicApiPdfReaderRef!.Prev()">Prev</BitButton>&nbsp;
                <BitTag Variant="BitVariant.Outline" Text="@($"{publicApiPdfReaderRef?.CurrentPageNumber.ToString()}/{publicApiPdfReaderRef?.NumberOfPages.ToString()}")" Color="BitColor.Info" />
                <BitButton OnClick="() => publicApiPdfReaderRef!.Next()">Next</BitButton>&nbsp;
                <BitButton OnClick="() => publicApiPdfReaderRef!.Last()">Last</BitButton>&nbsp;|
                <BitButton OnClick="ZoomOut">Zoom -</BitButton>
                <BitButton OnClick="ZoomIn">Zoom +</BitButton>
            </div>
            <br />
            <BitPdfReader @ref="publicApiPdfReaderRef" Config="publicApiConfig" OnPdfLoaded="() => StateHasChanged()" />
        </DemoExample>
    </Examples>
</DemoPage>